package com.设计模式;

import java.util.ArrayList;
import java.util.List;

public class 建造者模式
{
    public static void main(String[] args)
    {
        Builder builder = new Builder();
        builder.produceMailSender(10);
    }
}
class Builder{
    private List<Sender> list = new ArrayList<>();

    public void produceMailSender(int count){
        for (int i = 0; i < count; i++)
        {
            list.add(new MailSender());
        }
    }

    public void produceSmsSender(int count){
        for (int i = 0; i < count; i++)
        {
            list.add(new SmsSender());
        }
    }
}
